/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dominio.Controladores;

import Dominio.PalabraParaAnadir;
import Dominio.Tema;
import java.util.Vector;

/**
 *
 * @author sandra
 */
public class CtrlConsultaPalabras {

    private CtrlDominio CD = CtrlDominio.getInstance();

    public CtrlConsultaPalabras() {
        CD = CtrlDominio.getInstance();
    }

    public Vector<String> listarPalabras() {
        Vector<String> palabras = new Vector<String>();
        int tam = CD.getTotalPalabras();
        for (int i = 1; i < tam + 1; i++) {
            palabras.add(CD.consultarPalabra(i).getValor());
        }
        return palabras;
    }
    
    public Vector<String> listarTemasPalabra(int i){
        Vector<String> temas=new Vector<String>();
        PalabraParaAnadir pa=CD.consultarPalabra(i);
        for(Tema t:pa.getTemas()){
            temas.add(t.getNombre());
        }
        return temas;
    }
    
}
